<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateLocationsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('locations', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('code', 20)->unique()->comment('货架代码');
            $table->tinyInteger('attribute')->comment('货架属性: 0 良品货架 1 不良品货架 2 可销售不良品货架');
            $table->string('partition', 5)->comment('货架分区');
            $table->tinyInteger('status')->comment('货架状态');
            $table->integer('count')->default(0)->comment('货架批次数量');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('locations');
    }
}
